package com.zhkc.wisdom.common.web.desensitization.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zhkc.wisdom.common.web.desensitization.SensitiveSerialize;
import com.zhkc.wisdom.common.web.desensitization.SensitiveTypeEnum;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * 脱敏注解(如果自定义了 消息转换器 实现 WebMvcConfigurer,会导致脱敏失效,脱敏方法需要一起改动 ).
 *
 * @author kehong liu .
 */
//@Target({ ElementType.FIELD, ElementType.METHOD })
//@Retention(RetentionPolicy.RUNTIME)
//@Inherited
//@Documented
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveSerialize.class)
public @interface Desensitized {

	// 脱敏类型(规则)
	SensitiveTypeEnum type() default SensitiveTypeEnum.NO;

}
